var musicPlay=new Vue({
    el:"#musicPlay",
    data:{
        musicName:"薛之谦",
        musicNameList:[],
        musicUrl:"",
        musicImg:"",
        musicHot:[],
        musicMvUrl:"",
        musicMvshow:false,
        imgRota:false,
        musicPlay:""
    },
    methods:{
        selecMusic:function(){
            var that=this
            axios.get("https://autumnfish.cn/search?keywords="+this.musicName)
            .then(
                function(response){
                    that.musicNameList=response.data.result.songs
                    //console.log(response)
                },
                function(err){})
        },
        playMusicUrl:function(musicId){
            var that=this
            axios.get("https://autumnfish.cn/song/url?id="+musicId)
            .then(
                function(response){
                    that.musicUrl=response.data.data[0].url
                 // console.log(response.data.data[0].url)
                },
                function(err){}),
                axios.get("https://autumnfish.cn/song/detail?ids="+musicId)
            .then(
                function(response){
                    that.musicImg=response.data.songs[0].al.picUrl
                    //console.log(response.data.songs[0].al.picUrl)
                },
                function(err){}),
                axios.get("https://autumnfish.cn/comment/hot?type=0&id="+musicId)
                .then(
                    function(response){
                        that.musicHot=response.data.hotComments
                    },
                    function(err){})
        },
        musicMv:function(mvId){
            var that=this
            axios.get("https://autumnfish.cn/mv/url?id="+mvId)
                .then(
                    function(response){
                        that.musicMvUrl=response.data.data.url
                        that.musicMvshow=true
                       //console.log(that.musicMvshow)
                    },
                    function(err){})
        
        },
        musicdis:function(){
            this.musicMvshow=false
        },
        play:function(){
            this.musicPlay=true
        },
        pause:function(){
            this.musicPlay=false
        }

        
    }
})